package com.ouyu.factory.support;

import com.ouyu.factory.config.SingletonBeanRegistry;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: hz21056677
 * @Description:
 * @Date: Created in 17:36 2021/6/3
 */
public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {
    Map<String,Object> singletonObjects = new HashMap<>();
    @Override
    public Object getSingleton(String beanName) {
        return singletonObjects.get(beanName);
    }

    protected void addSingleton(String beanName, Object singletonObject) {
        singletonObjects.put(beanName,singletonObject);
    }
}
